﻿<phone:PhoneApplicationPage 
    x:Class="TravelWallet.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:advertising="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
    xmlns:AdDuplex="clr-namespace:AdDuplex;assembly=AdDuplex.AdControl.Silverlight"
    xmlns:adRotator="clr-namespace:AdRotator;assembly=AdRotator"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <UserControl.Resources>
        <DataTemplate x:Key="WalletItemTemplate">
            <Grid Margin="10,20,0,0" >
                <StackPanel>
                <TextBlock Style="{StaticResource PhoneTextExtraLargeStyle}" Text="{Binding Path=Program.Name, Mode=TwoWay}"/>
                <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="{Binding Number, Mode=TwoWay}" Foreground="DeepSkyBlue"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
        <DataTemplate x:Key="HotelItemTemplate">
            <Grid Margin="10,20,0,0" >
                <StackPanel>
                    <TextBlock Style="{StaticResource PhoneTextExtraLargeStyle}" Text="{Binding Path=Program.ProgramName, Mode=TwoWay}"/>
                    <TextBlock Style="{StaticResource PhoneTextLargeStyle}" Text="{Binding Number, Mode=TwoWay}" Foreground="DeepSkyBlue"/>
                </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <StackPanel Orientation="Vertical" Height="768" VerticalAlignment="Stretch">
        <controls:Pivot x:Name="p_Pivot" Title="TRAVEL WALLET" FontSize="24" Height="590" Padding="0,0,0,5">
            <controls:PivotItem x:Name="pi_Airlines" Header="Airlines">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox x:Name="lb_Airlines" Grid.Row="0" MouseLeftButtonUp="airlines_MouseLeftButtonUp"  ItemTemplate="{StaticResource WalletItemTemplate}" VerticalAlignment="Stretch"/>
                    </Grid>
                </controls:PivotItem>
            <controls:PivotItem x:Name="pi_Hotels" Header="Hotels">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox x:Name="lb_Hotels"  MouseLeftButtonUp="hotels_MouseLeftButtonUp"   ItemTemplate="{StaticResource HotelItemTemplate}" VerticalAlignment="Stretch"/>
                    </Grid>
                </controls:PivotItem>
            <controls:PivotItem x:Name="pi_RentalCars" Header="Car Rentals">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <ListBox x:Name="lb_RentalCars" MouseLeftButtonUp="cars_MouseLeftButtonUp"     ItemTemplate="{StaticResource WalletItemTemplate}" VerticalAlignment="Stretch"/>
                    </Grid>
             </controls:PivotItem>
        </controls:Pivot>
            <adRotator:AdRotatorControl x:Name="AdRotatorControl" Width="480" Height="80" SettingsUrl="http://oscialco.w06.winhost.com/travelwallet/travelwalletadrotatorsettings.xml" AdDuplexAppId="4927" AdMobAdUnitId="a14ed1983c2d888" PubCenterAdUnitId="77346" PubCenterAppId="a80c5364-e9f4-49e6-8296-25be1d3f2bd0" DefaultSettingsFileUri="/wp7AdRotatorSettings.xml" IsEnabled="True" />
            <HyperlinkButton  Content="Touch here to remove ads and store more than 5 programs" Style="{StaticResource HyperlinkButtonStyle}" x:Name="ad_upgradetofull" Foreground="#FF9C9EA0" HorizontalAlignment="Center" FontSize="17" NavigateUri="/BuyPage.xaml" Padding="0" Height="Auto" Width="Auto" VerticalAlignment="Bottom" Margin="0" VerticalContentAlignment="Top" FontWeight="Normal" />
        </StackPanel>
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.add.rest.png" Text="add" Click="b_Add_Click"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="about" Click="ApplicationBarMenuItem_Click_About"/>
                <shell:ApplicationBarMenuItem Text="rate" Click="ApplicationBarMenuItem_Click_Rate"/>
                <shell:ApplicationBarMenuItem Text="share" Click="ApplicationBarMenuItem_Click_Share"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>